package library.operation;

import library.book.Book;
import library.book.BookList;

import java.util.Scanner;

public class AddOperation implements Opretation{
    public void work(BookList bookList) {
        System.out.println("新增图书");
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入你要增加的书名");
        String name=scanner.nextLine();
        System.out.println("请输入作者");
        String author=scanner.nextLine();
        System.out.println("请输入类型");
        String type=scanner.nextLine();
        System.out.println("请输入价格");
        int price=scanner.nextInt();
        Book book = new Book(name,price,author,type);

        bookList.setbook(bookList.getBooksize(),book);
        bookList.setBooksize(bookList.getBooksize()+1);
    }
}
